package com.fqgj.sentry.policy.client;

import com.fqgj.sentry.policy.domain.policy.Policy;
import com.fqgj.sentry.policy.domain.policy.PolicyUpdate;
import com.fqgj.sentry.policy.entity.PcPolicyEntity;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: yujianfu (mr.vencnet@gmail.com)
 * Date: 2017/7/13
 * Time: 下午9:42
 */
public interface PolicyService {

    /**
     * 策略新增
     *
     * @param policy
     * @return
     */
    Boolean add(Long executorId, Long policySetsId, Long merchantId, Policy policy);

    PcPolicyEntity findById(Long policyId);

    /**
     * 策略修改
     *
     * @param policy
     * @return
     */
    Boolean update(Long policyId, PolicyUpdate policy);

    /**
     * 更新 策略排序
     *
     * @param policyId
     * @param sort
     * @return
     */
    Boolean updatePolicySort(Long policyId, Integer sort);

    /**
     * 策略删除
     *
     * @param policyId
     * @return
     */
    Boolean delete(Long merchantId, Long policyId);

    /**
     * 通过执行者id
     *
     * @param executorId
     * @return
     */
    List<PcPolicyEntity> selectPolicyByExecutorId(Long executorId);

    /**
     * 根据策略集  查询
     *
     * @param policySetId
     * @return
     */
    List<PcPolicyEntity> selectPolicyByPolicySetId(Long policySetId);


    /**
     * 通过 策略集 执行者
     *
     * @param executorId
     * @return
     */
    List<PcPolicyEntity> selectByPolicySetIdAndExecutorId(Long policySetId, Long executorId);
}
